package vn.com.horoscope.common;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import vn.com.horoscope.entities.ObjectParent;
import android.content.Context;
import android.util.Log;

public class StaticClass {
	public static final String tag = "vn.com.horoscope.debug";
	
	public static ObjectParent op = new ObjectParent();
	
	@SuppressWarnings("finally")
	public static String getContentData(Context context, String contentFilter) {
			BufferedReader in = null;
	        StringBuffer result = new StringBuffer();
	        try {
	            in = new BufferedReader(new InputStreamReader(context.getAssets().open(contentFilter)));
	            String cache = null;
	            // go to ID line in data file and break
	           
	            // get data
	            while ((cache = in.readLine()) != null) {
	            	result.append(cache);
	            	result.append("\n");
	            }
	        } catch (IOException e) {
	            Log.d(tag, "Cannot read asset file");
	        } catch (NullPointerException e) {
				Log.d(tag, "Null Pointer Exception");
			} finally {
	            try {
	                if (in != null) {
	                    in.close();
	                }
	            } catch (IOException e1) {
	                Log.d(tag, "Cannot close BufferedReader");
	            }

	            return result.toString();
	        }
		}
}
